console.log("======================================================content-script.js is running!!!")

//填充快递单号
$('.op_express_delivery_input_nu').val('73194968647599')

function eventFire(el, etype){
  // debugger
  if (el.fireEvent) {
    el.fireEvent('on' + etype);
  } else {
    var evObj = document.createEvent('Events');
    evObj.initEvent(etype, true, false);
    el.dispatchEvent(evObj);
  }
}

function triggerClick(){
// 触发提交按钮   这种方式无效，使用eventFire方法
//   console.log($('.op_express_delivery_submit'))
//   $('.op_express_delivery_submit').click()
//   console.log("run submit success!!!")
  
  
  let elements = document.getElementsByClassName("op_express_delivery_submit")
  console.log(elements)
  for (let element of elements) {
    //不能使用 element.click()，element.click()无效，使用eventFire方法
    eventFire(element, 'click')
  }
}

// triggerClick()

setTimeout(()=>{
  triggerClick()
}, 10000)


var myTimer=$.timerHandler('mytimer1').time('600s').call(function(count){
  //this => timerHandler Obj
  console.log('mytimer1 runing : '+count);
  window.location.reload()

}).start();


